package exercise.examples.eg3;


import java.util.Scanner;

public class _2 {
    public static void main(String[] args) {
        int point;
        Scanner sc=new Scanner(System.in);

        while(true){
            System.out.print("Please Enter a Point between 0 and 100 or -1 to quit>>");
            point=sc.nextInt();
            if(point==-1)
                break;
            else
                System.out.println(pointToGrade(point));
        }
    }
    static String pointToGrade(int point){
        String result="无效输入";
        if(point<=100&&point>=0)
            switch((int)(point/10)) {
                case 10:
                case 9:
                    result = "优";
                    break;
                case 8:
                    result = "良";
                    break;
                case 7:
                    result = "中";
                    break;
                case 6:
                    result = "及格";
                    break;

                default:
                    result = "不及格";
                    break;
            }
        else;
        return result;
    }
}
